<%@page import="java.util.Locale"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="java.util.List"%>
<%@page import="entity.Question" %>
<%@page import="entity.Author" %>
<% 
	request.setCharacterEncoding("utf-8");
	response.setHeader("Content-Type","text/html; charset=utf-8");
	response.setHeader("Vary","Accept-Encoding");
	response.setCharacterEncoding("utf-8");
%>
<% 
	HttpSession ss = request.getSession(true);
	ResourceBundle resource = (ResourceBundle) ss.getAttribute("language");
	String language = resource.getString("code");
	List<Question> listAsk = (List<Question>)request.getAttribute("listAsk");
	List<Question> listAnswer = (List<Question>)request.getAttribute("listAnswer");
	Author author = (Author)request.getAttribute("author");
	
	String title = (String) request.getAttribute("title");
	String description = (String) request.getAttribute("description");
	String keywords = (String) request.getAttribute("keyword");
	String path = request.getContextPath();
	String tag = "user";
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="tag" value="<%=tag %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>
	<jsp:param name="language" value="<%=language %>"/>
</jsp:include>

		<div class="bd">
			<div class="bl">
				<jsp:include page="element/adv3.jsp"></jsp:include>
				<br/><br/><br/>
				<h2><%=resource.getString("author") %> : <%=author.getName() %></h2>
				<div class="adt">
					<!-- AddThis Button BEGIN -->
					<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
					<a class="addthis_button_preferred_1"></a>
					<a class="addthis_button_preferred_2"></a>
					<a class="addthis_button_preferred_3"></a>
					<a class="addthis_button_preferred_4"></a>
					<a class="addthis_button_compact"></a>
					<a class="addthis_counter addthis_bubble_style"></a>
					</div>
					<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
					<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4d6f3cdb1d190d60"></script>
					<!-- AddThis Button END -->
				</div>
				<div class="adt so">
					<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
					<g:plusone size="standard" count="true"></g:plusone>
				</div>
				<div class="clear"></div>
				
				<br/>
				<div style="float: left;">
					<jsp:include page="/element/adv2.jsp"></jsp:include>
				</div>
				<div style="float: right;">
					<jsp:include page="/element/adv2.jsp"></jsp:include>
				</div>
				<div class="clear"></div>
				
				<%
				if(listAsk.size()>0)
				{
				%>
				<hr size="1"/>
				<h4><%=resource.getString("list_question") %>   ( <a href="<%=path %>/<%=language %>/author-question/<%= author.getAlias()%>"><%=resource.getString("view_all") %></a> )</h4>
				<div class="clear"></div>
				<ul class="lq">
					<%
						for(Question ask : listAsk)
						{
					%>
							<li>
								<h1><a href="<%=path %>/<%=language %>/question/<%=ask.getAlias() %>" title="#"><%=ask.getTitle() %></a></h1>
								<p>
									<%=ask.getSubContent() %>
								</p>
								
							</li>
					<%
						}
					%>
				</ul>
				<%
				}
				%>
				<%
				if(listAnswer.size()>0)
				{
				%>
				<hr size="1"/>
				<h4><%=resource.getString("list_anwer") %>  ( <a href="<%=path %>/<%=language %>/author-answer/<%= author.getAlias()%>"><%=resource.getString("view_all") %></a> )</h4>
				<div class="clear"></div>
				<ul class="lq">
					<%
					
						for(Question answer: listAnswer)
						{
					%>
							<li>
								<h1><a href="<%=path %>/<%=language %>/question/<%=answer.getAlias() %>" title="#"><%=answer.getTitle() %></a></h1>
								<p>
									<%=answer.getSubContent() %>
								</p>
								
							</li>
					<%
						}
					%>
				</ul>
				<%
				}
				%>
			</div>
			<div class="br">
				<jsp:include page="element/language.jsp">
					<jsp:param name="alias" value=""/>
					<jsp:param name="url" value="author"/>
				</jsp:include>
				<jsp:include page="element/tag.jsp">
					<jsp:param name="language" value="<%=language %>"/>
				</jsp:include>
				<jsp:include page="element/recent_view.jsp">
					<jsp:param name="language" value="<%=language %>"/>
				</jsp:include>
				<jsp:include page="element/random.jsp">
					<jsp:param name="language" value="<%=language %>"/>
				</jsp:include>

			</div>
			<div class="clear"></div>
		</div>
<jsp:include page="/layout/footer.jsp">
	<jsp:param name="language" value="<%=language %>"/>
</jsp:include>	